<?php

namespace App\Http\Controllers\Admin;

use App\Http\Models\Menu;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class LoginController extends Controller
{
    /**
     * 登录页面展示
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index(){
        return view("admin.login.index");
    }

    /**
     * 登录校验
     */
    public function check(){
//        $menuObj = Menu::select("id","pid","name","icon","action")->orderBy("sort")->get()->toArray();
//        $menu = createArrTree($menuObj);
//        session(['menu'=>$menu]);
//        //默认第一个菜单选中
//        session(['menu_now'=>[
//            'first' => $menu[0]['name'],
//            'child' => "",
//            'show'  => $menu[0]['name'],
//        ]]);
        return redirect(route("admin.index"));
    }
}
